home *** CD-ROM | disk | FTP | other *** search
/ Nejlepší hry / Nejlepsi hry.iso / hry / sea of chaos / sea_install.msi / _15C39AAA7726369D39812BD40F01CF6A / _C94E18348F164483BCB73AA76B24D062 < prev    next >
Text File  |  2005-03-01  |  578b  |  30 lines

  1. //combine color and texture sample, and clip if alpha from texture isn't near max
  2. //Luke Lenhart
  3. //(C)2004-2005 Digipen Institute of Technology
  4.  
  5. //texture sampler
  6. sampler2D sampTex;
  7.  
  8. //shader input
  9. struct PS_INPUT
  10. {
  11.     float4 Color : COLOR;
  12.     float2 Tex0 : TEXCOORD0;
  13. };
  14.  
  15. //shader code
  16. float4 PShader(PS_INPUT In) : COLOR
  17. {
  18.     //sample textutes
  19.     float4 texclr=tex2D(sampTex,In.Tex0);
  20.     
  21.     //texkill if alpha from texture isn't near full
  22.     clip(texclr.a-0.5f);
  23.     
  24.     //blend with vert color
  25.     float4 clr=texclr*In.Color;
  26.     
  27.     //spit out color
  28.     return clr;
  29. }
  30.